/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.team.app.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.Size;

/**
 *
 * @author donnv
 */
@Entity
@Table(name = "employee", catalog = "", schema = "")
public class Employee implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "emp_id")
    private Long empId;
    @Size(max = 45)
    @Column(name = "emp_name", length = 45)
    private String empName;
    @Column(name = "emp_gender")
    private Long empGender;
    @Size(max = 45)
    @Column(name = "emp_dob", length = 45)
    private String empDob;
    @Size(max = 45)
    @Column(name = "emp_id_number", length = 45)
    private String empIdNumber;
    @Size(max = 45)
    @Column(name = "emp_phone", length = 45)
    private String empPhone;
    @Size(max = 45)
    @Column(name = "emp_mail", length = 45)
    private String empMail;
    @Size(max = 45)
    @Column(name = "emp_acc_no", length = 45)
    private String empAccNo;
    @Column(name = "emp_hire_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date empHireDate;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "emp_salary", precision = 22)
    private Double empSalary;
    @Size(max = 45)
    @Column(name = "emp_address", length = 45)
    private String empAddress;
    @Size(max = 255)
    @Column(name = "emp_responsibility", length = 255)
    private String empResponsibility;
    @Column(name = "is_status")
    private Long isStatus;
    @Column(name = "image")
    private String image;
    @OneToMany(mappedBy = "empId")
    private List<Rentprice> rentpriceList;
    @JoinColumn(name = "role_id", referencedColumnName = "role_id", nullable = false)
    @ManyToOne(optional = false)
    private Role roleId;
    @JoinColumn(name = "city_id", referencedColumnName = "city_id", nullable = false)
    @ManyToOne(optional = false)
    private City cityId;
    @JoinColumn(name = "company_id", referencedColumnName = "company_id")
    @ManyToOne
    private Company companyId;

    public Employee() {
    }

    public Employee(Long empId) {
        this.empId = empId;
    }

    public Long getEmpId() {
        return empId;
    }

    public void setEmpId(Long empId) {
        this.empId = empId;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public Long getEmpGender() {
        return empGender;
    }

    public void setEmpGender(Long empGender) {
        this.empGender = empGender;
    }

    public String getEmpDob() {
        return empDob;
    }

    public void setEmpDob(String empDob) {
        this.empDob = empDob;
    }

    public String getEmpIdNumber() {
        return empIdNumber;
    }

    public void setEmpIdNumber(String empIdNumber) {
        this.empIdNumber = empIdNumber;
    }

    public String getEmpPhone() {
        return empPhone;
    }

    public void setEmpPhone(String empPhone) {
        this.empPhone = empPhone;
    }

    public String getEmpMail() {
        return empMail;
    }

    public void setEmpMail(String empMail) {
        this.empMail = empMail;
    }

    public String getEmpAccNo() {
        return empAccNo;
    }

    public void setEmpAccNo(String empAccNo) {
        this.empAccNo = empAccNo;
    }

    public Date getEmpHireDate() {
        return empHireDate;
    }

    public void setEmpHireDate(Date empHireDate) {
        this.empHireDate = empHireDate;
    }

    public Double getEmpSalary() {
        return empSalary;
    }

    public void setEmpSalary(Double empSalary) {
        this.empSalary = empSalary;
    }

    public String getEmpAddress() {
        return empAddress;
    }

    public void setEmpAddress(String empAddress) {
        this.empAddress = empAddress;
    }

    public String getEmpResponsibility() {
        return empResponsibility;
    }

    public void setEmpResponsibility(String empResponsibility) {
        this.empResponsibility = empResponsibility;
    }

    public Long getIsStatus() {
        return isStatus;
    }

    public void setIsStatus(Long isStatus) {
        this.isStatus = isStatus;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public List<Rentprice> getRentpriceList() {
        return rentpriceList;
    }

    public void setRentpriceList(List<Rentprice> rentpriceList) {
        this.rentpriceList = rentpriceList;
    }

    public Role getRoleId() {
        return roleId;
    }

    public void setRoleId(Role roleId) {
        this.roleId = roleId;
    }

    public City getCityId() {
        return cityId;
    }

    public void setCityId(City cityId) {
        this.cityId = cityId;
    }

    public Company getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Company companyId) {
        this.companyId = companyId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (empId != null ? empId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Employee)) {
            return false;
        }
        Employee other = (Employee) object;
        if ((this.empId == null && other.empId != null) || (this.empId != null && !this.empId.equals(other.empId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.team.app.model.Employee[ empId=" + empId + " ]";
    }
    
}
